Miles Sound System SDK 7.2a

DDK Function: 505H Protect/Unprotect Timbre

Discussion

Input:

AX = 505H
BX = Driver number
CX = Bank (CH)/patch (CL) specifier to protect/unprotect
DX = 1: Protect timbre
DX = 0: Unprotect timbre

Output:

AX = 1: Timbre was previously protected from deletion
AX = 0: Timbre was not previously protected from deletion

This function prevents timbre CX from being discarded from the synthesizer memory or local timbre cache ("protected"), or subjects the timbre to the action of the synthesizer's normal timbre replacement algorithm ("unprotected").

If the synthesizer memory or local timbre cache does not contain sufficient space for a timbre to be installed by Function 503H (Install Timbre Set), one or more timbres (typically the timbre(s) least recently used to play notes) may be discarded from memory to make room. This function provides a means of protecting a given timbre against deletion, and of removing such protection. Neither function will have any immediate effect on the contents of timbre memory.

Timbres installed with Function 503H (Install Timbre Set) are "unprotected" by default. Timbre protection may be useful in cases where it is desirable to play little-used sound-effect or music sequences at widely varying intervals during the course of an application, while avoiding any delays associated with loading and transmitting their custom timbres. Excessive use of timbre protection may cause infinite loops to occur at runtime, since the caching mechanism may be forced to discard timbres which were requested and loaded earlier in the current call to Function 503H (Install Timbre Set).

If both the bank and patch specifiers are equal to -1 (CX = 0FFFFH), the function will protect or unprotect all timbres in the cache.

The action of this function is analogous to the Extended MIDI Control Change event 113 (Timbre Protect). Not all synthesizers which perform timbre management must support this function, however.

This function returns 0 if the previous timbre protection state is unknown.


Group: DOS XMIDI Sound Driver Interface

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.